<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>登陆界面</title>
<script src="/js/vue/vue.min.js"></script>
<script src="/js/jquery/jquery.min.js"></script>
<script src="/js/laypage/laypage.js" charset="utf-8"></script>
<script src="/js/layer/layer.js" charset="utf-8"></script>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="alternate icon" type="image/png" href="/assets/i/favicon.png">
<link rel="stylesheet" href="/assets/css/amazeui.min.css" />
<style>
.header {
	text-align: center;
}

.header h1 {
	font-size: 200%;
	color: #333;
	margin-top: 30px;
}

.header p {
	font-size: 14px;
}
</style>
</head>
<body>
	<div class="header">
		<div class="am-g">
			<h1>世界由你掌控</h1>
			<p>Integrated Development Environment</p>
		</div>
		<hr />
	</div>
	<div class="am-g">
		<div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
			<h1>用户登录</h1>
			<hr>
			<div class="am-btn-group">
				<a href="#" class="am-btn am-btn-secondary am-btn-sm"><i
					class="am-icon-github am-icon-sm"></i> Github</a> <a href="#"
					class="am-btn am-btn-success am-btn-sm"><i
					class="am-icon-google-plus-square am-icon-sm"></i> Google+</a> <a
					href="#" class="am-btn am-btn-primary am-btn-sm"><i
					class="am-icon-stack-overflow am-icon-sm"></i> stackOverflow</a>
			</div>
			<br> <br>

			<form method="post" class="am-form">
				<label for="username">用户名:</label> <input type="text" name=""
					id="username" value=""> <br> <label for="password">密码:</label>
				<input type="password" name="" id="userpwd" value=""> <br> <label
					for="remember-me"> <input id="remember-me" type="checkbox">
					记住密码
				</label> <br />
				<div class="am-cf">
					<input type="button" id="login" name="" value="登 录"
						class="am-btn am-btn-primary am-btn-sm am-fl">
				</div>
			</form>
			<hr>
			<p>© 2016 AllMobilize, Inc. Licensed under MIT license.</p>
		</div>
	</div>
	<script>
		$("#login").click(function() {
			$.ajax({
				type : "POST",
				url : "/user/login",
				dataType　:"json",
				data : {
					"name": $("#username").val(),
					"password":$("#userpwd").val()
				},
				success : function(data) {
					if(data!=null){
						window.location.href='/user_list.html';
					}else{
						alert("用户名或者密码错误！")
						window.location.href='/login.html';
					}
				       
				}
				
			});

		});
	</script>
</body>
</html>
